/* rcctwbu3.p - Container Workbench - Set new level for records in a chain    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.4.1.2 $                                                           */
/*V8:ConvertMode=NoConvert                                                 */
/* REVISION: 7.5    LAST MODIFIED: 03/21/95       BY: GWM *J049*              */
/* REVISION: 8.6    LAST MODIFIED: 09/20/96       BY: TSI *K005*              */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98       BY: *K1Q4* Alfred Tan       */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00       BY: *N0KP* Mark Brown       */
/* $Revision: 1.4.1.2 $    BY: Jean Miller    DATE: 03/22/01 ECO: *P008*          */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{mfdeclre.i}

/* INPUT PARAMETERS */
define input parameter abs_recid as recid.

/* LOCAL VARIABLES */
define variable par_id    like abs_par_id   no-undo.
define variable ship_from like abs_shipfrom no-undo.

find abs_mstr where recid(abs_mstr) = abs_recid no-lock.

assign
   par_id = abs_mstr.abs_id
   ship_from = abs_shipfrom.

/* SET SHIPTO FOR ALL CHILD CONTAINERS */
for each abs_mstr where
         abs_mstr.abs_shipfrom = ship_from
     and abs_mstr.abs_par_id = par_id
exclusive-lock:

   /* Delete absr_det records */
   if abs_id begins "I"
   then do:
      {gprun.i ""rcdlabsr.p"" "(input recid(abs_mstr))"}
   end.

   {gprun.i ""rcctwbu3.p"" "(input recid(abs_mstr))"}.

   abs_mstr.abs__qad06 = string(integer(abs_mstr.abs__qad06) - 1,"9").

end.
